<?php
declare (strict_types = 1);

namespace app\Api\controller;

use think\facade\Db;
use think\Request;
use think\response\Json;

class Dict
{
    protected  $gender=[
        ['value'=>1,'label'=>'男','tag'=>'primary'],
        ['value'=>0,'label'=>'女','tag'=>'danger']
    ];

    /**获取字典参数
     * @param $field
     * @return Json
     */
    public function options($field): Json
    {
        return success($this->$field);
    }
    public function area($id){
        $data = Db::name('area')->where('parent_id','=',$id)->select();
        return  success($data);
    }
}
